/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package GUI;

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.JFrame;
import javax.swing.JTextField;

/**
 *
 * @author yoav
 */
public class myTextButton extends JTextField implements ActionListener {

    public static final int regularId = 0;
    public static final int shiftId = 1;
    public static final int altId = 2;
    public static final int ctrlId = 3;
    //private int Id;
    private String KeyId = null;
    private String shiftLabel = "";
    private String altLabel = "";
    private String ctrlLabel = "";
    private String regularLabel = "";
    private boolean bindingsToShift = false;
    private boolean bindingsToAlt = false;
    private boolean bindingsToCtrl = false;

    public myTextButton() {

        this.addActionListener(this);
    }

    public void setKeyId(String KeyId) {
        this.KeyId = KeyId;
    }

    public String getKeyId() {
        return KeyId;
    }

    public boolean isBindingsToAlt() {
        return bindingsToAlt;
    }

    public boolean isBindingsToCtrl() {
        return bindingsToCtrl;
    }

    public boolean isBindingsToShift() {
        return bindingsToShift;
    }

    public void setBindingsToAlt(boolean bindingsToAlt) {
        this.bindingsToAlt = bindingsToAlt;
    }

    public void setBindingsToCtrl(boolean bindingsToCtrl) {
        this.bindingsToCtrl = bindingsToCtrl;
    }

    public void setBindingsToShift(boolean bindingsToShift) {
        this.bindingsToShift = bindingsToShift;
    }
    /*
    public void setButtonId(int Id) {
    this.Id = Id;
    }

    public int getButtonId() {
    return Id;
    }
     */

    public void setRegularLabel(String regularLabel) {
        this.regularLabel = regularLabel;
    }

    public String getRegularLabel() {
        if (regularLabel == null) {
            return "";
        }
        return regularLabel;
    }

    public String getAltLabel() {
        if (altLabel == null) {
            return "";
        }
        return altLabel;
    }

    public String getCtrlLabel() {
        if (ctrlLabel == null) {
            return "";
        }
        return ctrlLabel;
    }

    public String getShiftLabel() {
        if (shiftLabel == null) {
            return "";
        }
        return shiftLabel;
    }

    public void setAltLabel(String altLabel) {
        this.altLabel = altLabel;
    }

    public void setCtrlLabel(String ctrlLabel) {
        this.ctrlLabel = ctrlLabel;
    }

    public void setShiftLabel(String shiftLabel) {
        this.shiftLabel = shiftLabel;
    }

    public void actionPerformed(ActionEvent e) {
        System.out.println("BUTTON" + regularLabel + "pressed!!");
    }
}
